import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/index.vue'

Vue.use(VueRouter)

const routes = [{
        path: "/",
        redirect: "/home"
    },
    {
        path: '/home',
        name: 'Home',
        component: Home
    },
    {
        path: "/reg",
        name: "reg",
        component: () =>
            import ("../components/Reg.vue")
    },
    {
        path: "/coursebuy",
        name: "coursebuy",
        component: () =>
            import ("../views/CourseBuy/CourseBuy.vue")
    },
    {
        path: "/learn",
        name: "learn",
        component: () =>
            import ("../views/Learn/index.vue")
    },
    {
        path: "/login",
        name: "login",
        component: () =>
            import ("../components/Login.vue")
    },
    {
        path: "/courselist",
        name: "courselist",
        component: () =>
            import ("../views/CourseList/index.vue")
    },
    {
        path: "/mine",
        name: "mine",
        component: () =>
            import ("../views/Mine/index.vue")
    },
    {
        path: "/mycourse",
        name: "mycourse",
        component: () =>
            import ("../views/MyCourse/index.vue")
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router